package com.task.server.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.task.mapper.GroupsMapper;
import com.task.pojo.Groups;
import com.task.server.GroupsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author JiaFuJun
 * @version v1.0
 * @date 2020-03-25
 */
@Service
public class GroupsServiceImpl implements GroupsService {
    @Autowired
    private GroupsMapper groupsMapper;

    @Override
    public void insert(Groups record) {
        groupsMapper.insert(record);
    }

    @Override
    public void update(Groups record){
        groupsMapper.update(record);
    }

    @Override
    public void del(Object id){
        groupsMapper.del(id);
    }

    @Override
    public Groups selectByPrimaryKey(Object id){
        return groupsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Groups> getList(Groups record){
        return groupsMapper.selectByRecord(record);
    }

    @Override
    public PageInfo<Groups> pageList(Groups record, Integer pageNo, Integer pageSize){
        PageHelper.startPage(pageNo, pageSize);
        List<Groups> list = groupsMapper.selectByRecord(record);
        return new PageInfo<>(list);
    }

}